package com.BlogPark.service.FeedbackService.impl;

import com.BlogPark.mapper.FeedbackMapper;
import com.BlogPark.pojo.Feedback;
import com.BlogPark.service.FeedbackService.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public int addFeedback(Feedback feedback) {
        int row = feedbackMapper.addFeedback(feedback);
        return row;
    }

    @Override
    public List<Feedback> showFeedback() {
        List<Feedback> feedbacks = feedbackMapper.showFeedback();
        return feedbacks;
    }

    @Override
    public int deleteFeedback(Integer id) {
        int row = feedbackMapper.deleteFeedback(id);
        return row;
    }

    @Override
    public List<Feedback> showFeedbackByUserId(Integer userId) {
        List<Feedback> feedbacks = feedbackMapper.showFeedbackByUserId(userId);
        return feedbacks;
    }
}
